package svc

import (
	redis2 "gitee.com/Cauchy_AQ/vxopen/model/redis"
	"gitee.com/Cauchy_AQ/vxopen/rpc/transform/internal/config"
	"github.com/redis/go-redis/v9"
)

type ServiceContext struct {
	Config config.Config
	RDB    *redis.Client
}

func NewServiceContext(c config.Config) *ServiceContext {
	rdb, err := redis2.GetRedisInstance(c.ModelConfig)
	if err != nil {
		panic(err)
	}
	return &ServiceContext{
		Config: c,
		RDB:    rdb,
	}
}
